-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CBRD-25762] When a general user performs a trigger unload, remove [user_schema] from condition and action_definition if the owner is the user themselves. #5731
base: develop
Are you sure you want to change the base?
Conversation
…rom condition and action_definition if the owner is the user themselves.
output_ctx ("/* ERROR : IF %s */\n", trigger->condition->source); | ||
error = ER_OUT_OF_VIRTUAL_MEMORY; | ||
er_set (ER_ERROR_SEVERITY, ARG_FILE_LINE, ER_OUT_OF_VIRTUAL_MEMORY, 1, (size_t) length); | ||
free_and_init (text); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
free_and_init (text); |
text == NULL 이기 때문에 free_and_init 을 하지 않아도 될 것 같습니다.
parser = parser_create_parser (); | ||
if (parser == NULL) | ||
{ | ||
output_ctx ("/* ERROR : IF %s */\n", trigger->condition->source); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아래 로직에서 parser 에 접근하기 때문에, parser == NULL 이면 함수를 종료해야 할 필요가 있어 보입니다.
query_condition_result = parser_print_tree_with_quotes (parser, *condition_node); | ||
|
||
/* remove appended trigger evaluate info */ | ||
p = strstr (query_condition_result, remove_eval_prefix); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
p == NULL 을 처리해야 할 필요가 있어 보입니다.
if (parser == NULL) | ||
{ | ||
output_ctx ("\n/* ERROR : EXECUTE %s */\n", trigger->action->source); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아래 로직에서 parser 에 접근하기 때문에, parser == NULL 이면 함수를 종료해야 할 필요가 있어 보입니다.
if (p != NULL) | ||
{ | ||
p = (char *) memmove (p, p + strlen (remove_eval_prefix), strlen (p) - strlen (remove_eval_prefix) + 1); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
else 구문으로 P가 NULL인 경우에 대한 처리가 필요합니다.
const char *eval_prefix = "EVALUATE ( "; | ||
const char *eval_suffix = " ) "; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trigger_manager.c 에 EVAL_PREFIX 와 EVAL_SUFFIX 가 static const char 로 선언되어 있는데, 이것을 활용할 수 있도록 수정하는 것이 더 좋을 거 같습니다.
if (remove_eval_suffix_len > 0 && p[remove_eval_suffix_len - 1] == ')') | ||
{ | ||
p[remove_eval_suffix_len - 1] = '\0'; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
remove_eval_prefix로 시작했는데 끝에 ')'가 오지 않는 경우가 있을 수 있나요?
-
" ... ) " 와 같이 ')' 이후에 공백 문자가 포함되어 있을 가능성은 없나요?
p = (char *) memmove (p, p + strlen (remove_eval_prefix), strlen (p) - strlen (remove_eval_prefix) + 1); | ||
} | ||
|
||
remove_eval_suffix_len = strlen (p); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
362라인이 잘 수행된 후에는
remove_eval_suffix_len는 strlen (p) - strlen (remove_eval_prefix) 와 같아야겠지요?
http://jira.cubrid.org/browse/CBRD-25762
Purpose
기존 Trigger의 경우 name과 target_class에서 [user_schema]가 제거되지만, condition 및 action_definition에 사용된 쿼리 내 [user_schema]는 제거되지 않는 문제를 수정 합니다.
Repro
Expected
Actual
Implementation
N/A
Remarks
N/A